Rapid Application Development with AWS Amplify by Adrian Leung

Rapid Application Development with AWS Amplify by Adrian Leung

Author:Adrian Leung [Adrian Leung]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2021-07-15T16:00:00+00:00


Figure 5.2 – Autogenerated GraphQL operations and API code

Let's open the mutations.ts file to see the code that has been generated by the Amplify CLI based on the Post model that we just created:

Figure 5.3 – Mutations

The Amplify CLI generated three methods for us: createPost, updatePost, and deletePost. These are the Mutation GraphQL operations for creating, updating and deleting a post on the database. All we need to do is to call the autogenerated methods to access the backend, which saves us heaps of time.

Here, we will create a web app interface as an example for the user to create a blog post. Open the App.css file in the project directory and perform the following steps:

Import the Oswald font from Google Fonts (https://fonts.google.com/) as the typography for the web app:@import url("https://fonts.googleapis.com/css2?family=Oswald");

* {

font-family: "Oswald", serif;

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.